docs: deduplicate stats docstrings and link to algorithms (#621)#726
Merged
Conversation
Several stats are thin wrappers around xgi.algorithms functions but were carrying their own copies of the formulas, references, and notes. Those copies had drifted from the originals. Rewrites the wrapper stat docstrings to point at the algorithm via See Also rather than re-explaining. Adds a short stat-accessor note to each algorithm so users discover both calling conventions from either direction. Affects clustering_coefficient, local_clustering_coefficient, two_node_clustering_coefficient, clique_eigenvector_centrality, h_eigenvector_centrality, z_eigenvector_centrality, node_edge_centrality, katz_centrality, and the local simpliciality stats. Closes #621 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #726 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 66 66
Lines 5207 5207
=======================================
Hits 4878 4878
Misses 329 329 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
Amazing!! Thanks Leo |
maximelucas
approved these changes
May 28, 2026
Collaborator
|
@leotrs @kaiser-dan same, this was merged into |
Collaborator
Author
|
Acknowledged — see my reply on #727. All recovered via backmerge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #621. Several stats (in
xgi.stats.nodestatsandxgi.stats.edgestats) are thin wrappers aroundxgi.algorithmsfunctions but were carrying their own copies of formulas, references, and notes. Those copies had drifted from the originals.This PR makes the algorithms module the single source of truth:
See Alsorather than re-explainingH.nodes.clustering_coefficient") so users find both calling conventions from either directionCombined with the docstring forwarding from #708,
H.nodes.clustering_coefficient?now shows the short pointer doc instead of duplicated content, and one click takes you to the authoritative algorithm doc.Affects:
clustering_coefficient,local_clustering_coefficient,two_node_clustering_coefficient,clique_eigenvector_centrality,h_eigenvector_centrality,z_eigenvector_centrality,node_edge_centrality(node and edge),katz_centrality, and the three local simpliciality stats.Test plan
H.nodes.<stat>.__doc__